home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h_doc / Pane < prev    next >
Text File  |  1996-05-22  |  5KB  |  150 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane.h
  12.     Author:  Copyright © 1994 Ainsley Pereira. Complete revision by Keith Hall
  13.     Version: 1.11 (30th March 1994)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. /*
  18.  * Implementation notes
  19.  * --------------------
  20.  * The offset of the pane from the master window is taken from their initial
  21.  * positions, so make sure that they are in the right places relative to each
  22.  * other when you save them from Glazier (or FormEd if you have a pet
  23.  * triceratops ;-)
  24.  * Another point is that the relative positions are kept constant from the top
  25.  * left of the visible area. This only matters if the master window is
  26.  * resizeable. The top left was chosen as most panes are either in fixed size
  27.  * windows (eg. Options windows) or are down the top left of a window (eg.
  28.  * Artworks, Draw etc.)
  29.  * If you want to do something like StrongEd's status bar then you'll have to
  30.  * a) Alter Desk_pane_data.offset.y everytime you resize the window, or
  31.  * b) Alter the code to use xxxxx.min.y - yyyyy.min.y (although then you can't
  32.  *    have the Artworks/Draw style panes).
  33.  */
  34.  
  35. #ifndef __Desk_Pane_h
  36. #define __Desk_Pane_h
  37.  
  38. #ifdef __cplusplus
  39.     extern "C" {
  40. #endif
  41.  
  42.  
  43. #ifndef __Desk_Wimp_h
  44.     #include "Desk.Wimp.h"
  45. #endif
  46.  
  47. #ifndef __Desk_Window_h
  48.     #include "Desk.Window.h"
  49. #endif
  50.  
  51. #ifndef __Desk_WimpSWIs_h
  52.     #include "Desk.WimpSWIs.h"
  53. #endif
  54.  
  55. typedef struct
  56. {
  57.   Desk_window_handle master;
  58.   Desk_window_handle pane;
  59.   Desk_wimp_point    offset;
  60.   Desk_wimp_point    size;
  61.   union
  62.   {
  63.     int value;
  64.     struct
  65.     {
  66.       unsigned int isopen :1;  /* master/pane pair currently displaying */
  67.       unsigned int fixed  :1;  /* pane sticks to position relative to top of master */
  68.       unsigned int resize :1;  /* pane shrinks with relation to size of master */
  69.       unsigned int horiz  :1;  /* pane is horizontal (shrinks to left when resize flag set
  70.                                   and window gets resized (like !StrongEd toolbar) */
  71.       unsigned int vert   :1;  /* pane is horizontal (shrinks to top when resize flag set
  72.                                   and window moves (like !Draw) */
  73.       unsigned int dummy  :27;
  74.     } data;
  75.   } flags;
  76. } Desk_pane_data;
  77.  
  78. #define Desk_pane_OPEN   0x0001
  79. #define Desk_pane_FIXED  0x0002
  80. #define Desk_pane_RESIZE 0x0004
  81. #define Desk_pane_HORIZ  0x0008
  82. #define Desk_pane_VERT   0x0010
  83.  
  84.  
  85. extern Desk_bool Desk_Pane_OpenEventHandler(Desk_event_pollblock *event, void *reference);
  86. /*
  87.  * Install as a handler for Desk_event_OPEN on the master window.
  88.  * It opens the pane at the correct offset at the correct size.
  89.  */
  90.  
  91.  
  92. extern Desk_pane_data *Desk_Pane_GetSysHandle(Desk_window_handle master);
  93. /*
  94.  * 
  95.  * Returns a pointer to the Desk_pane_data structure associated with the 'master' window.
  96.  * Returns NULL if the master window isn't linked.
  97.  */
  98.  
  99.  
  100. extern int Desk_Pane_SetFlags(Desk_window_handle master, int flags);
  101. /*
  102.  * Sets the flags of the Pane/Master window relationship.
  103.  * Returns the current flags if 'flags' is -1.
  104.  * Returns NULL if the master window isn't linked.
  105.  */
  106.  
  107.  
  108. extern void Desk_Pane_Link(Desk_window_handle mast, Desk_window_handle pane,
  109.                       Desk_wimp_point *offset, Desk_wimp_point *size, int flags);
  110. /*
  111.  * 
  112.  * Links the pane window handle to the master window handle.
  113.  * if offset or size == NULL then the data is taken from the template
  114.  */
  115.  
  116.  
  117. extern Desk_window_handle Desk_Pane_CreateAndLink(char *mastname, char *panename,
  118.                                         int mastmaxsize, int panemaxsize,
  119.                                         Desk_wimp_point *offset, Desk_wimp_point *size, int flags);
  120. /*
  121.  * Creates the windows using Desk_Window_Create and then Desk_Pane_Links them together.
  122.  * returns window handle of the master window
  123.  * if offset or size == NULL then the data is taken from the template
  124.  */
  125.  
  126. extern void Desk_Pane_Show(Desk_window_handle window, Desk_window_openpos openpos);
  127. /*
  128.  * Simply calls Desk_Window_Show for the master window and the pane.
  129.  */
  130.  
  131.  
  132. extern void Desk_Pane_Delete(Desk_window_handle window);
  133. /*
  134.  * Calls Desk_Window_Delete for the master window and the pane and de-links them
  135.  */
  136.  
  137.  
  138. extern void Desk_Pane_Hide(Desk_window_handle window);
  139. /*
  140.  *
  141.  * Simply calls Desk_Window_Hide for the master window and the pane.
  142.  */
  143.  
  144. #ifdef __cplusplus
  145. }
  146. #endif
  147.  
  148.  
  149. #endif
  150.